#ifndef CLIPBOARDPAGE_H
#define CLIPBOARDPAGE_H

#include <atlcrack.h>
#include "PropPage.h"
#include "ExListViewCtrl.h"

class ClipboardPage : public CPropertyPage<IDD_CLIPBOARD>, public PropPage
{
public:
	ClipboardPage(SettingsManager *s) : PropPage(s) { 
		SetTitle(CTSTRING(SETTINGS_CLIPBOARD));
		m_psp.dwFlags |= PSP_HASHELP;
	};
	~ClipboardPage() { 
		ctrlParams.Detach();
	};

	BEGIN_MSG_MAP_EX(ClipboardPage)
		MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
		COMMAND_ID_HANDLER(IDC_ADD, onBtn)
		COMMAND_ID_HANDLER(IDC_REMOVE, onBtn)
		COMMAND_ID_HANDLER(IDC_CHANGE, onBtn)
		NOTIFY_HANDLER(IDC_PARAM_ITEMS, NM_DBLCLK, onDblClick)
	END_MSG_MAP()

	LRESULT onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT onBtn(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	LRESULT onDblClick(int /*idCtrl*/, LPNMHDR /* pnmh */, BOOL& bHandled) {
		return onBtn(0, IDC_CHANGE, 0, bHandled);
	}
	
	// Common PropPage interface
	PROPSHEETPAGE *getPSP() { return (PROPSHEETPAGE *)*this; }
	virtual void write();

protected:
	ExListViewCtrl ctrlParams;
	static Item items[];
	static TextItem texts[];
};

#endif //CLIPBOARDPAGE_H